<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="../../img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../css/app.css">
    <link rel="stylesheet" type="text/css" href="../css/message.css">
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
    <style>
        .sysTitle { text-align:center; }
        p { margin:10px 0; }
        hr { margin:10px 0;height:1px;
            border:0;border-bottom:1px solid #f0f0f0; }
        th,td { padding:10px;border:1px solid #f0f0f0; }
        td { text-align:center; }
    </style>
</head>
<body>
<!--
    制作者：九哥
    页面：准消息
    时间：2019-07-23
-->





<!----------系统消息---------->
<div id="messagePageStyle1">
    <div id="msgTitle">
        <b>准消息</b>
        <img src="../images/return.png" id="msgComRtn">
    </div>
    <div style="height:40px;"></div>
    <div id="locateMessage">
        <div class="aui-tab message_content">
            <!--<div class="load">努力加载中...</div>-->
            <div class="aui-flex b-line">
                <div class="aui-flex-box">
                    <h3 class="sysTitle">准介绍下载量</h3>
                    <hr>
                    <p>介绍公司得5分，
                        介绍工厂得3分，
                        介绍员工得1分。
                        积分累积越高越好，
                        可以增加找工作、找订单、找客户、找代理、找加盟的权重。
                    </p>
                    <br>
                    <table width="100%" cellspacing="0">
                        <tr>
                            <th>你的介绍</th>
                            <th>数量</th>
                            <th>总积分</th>
                        </tr>
                        <tr>
                            <td>公司</td>
                            <td><span id="comNum">0</span>家</td>
                            <td><span id="comScore">0</span>分</td>
                        </tr>
                        <tr>
                            <td>工厂</td>
                            <td><span id="facNum">0</span>家</td>
                            <td><span id="facScore">0</span>分</td>
                        </tr>
                        <tr>
                            <td>员工</td>
                            <td><span id="staffNum">0</span>人</td>
                            <td><span id="staffScore">0</span>分</td>
                        </tr>
                    </table>
                    <br>
                    <p>总积分：<span id="totalScore"></span>分</p>
                </div>
            </div>
        </div>
    </div>

</div>
<!----------系统消息---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../js/app.js"></script>
<script type="text/javascript" src="../js/messagePageChange.js"></script>
<script type="text/javascript" src="../js/msg.js"></script> 
<script>
    (function(){
        getIndex();
    })();
    /**
     * 获取积分列表
     * */
    function getIndex(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo==null || userInfo.token=='undefined') {
            getErrMsg('没有登录！',''); return;
        }
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            type:userInfo.type,
            cate:userInfo.cate
        };
        $.ajax({
            type: 'post',
            url: getDomain() + 'score',
            data: formData,
            success: function (res) {
//                console.log(res);
//                return;
                if (res.code != 0) {
                    console.log(res); return
                }
                var resData = res.data;
                console.log(resData);
                $('#comNum').html(resData.com.num);
                $('#comScore').html(resData.com.score);
                $('#facNum').html(resData.fac.num);
                $('#facScore').html(resData.fac.score);
                $('#staffNum').html(resData.staff.num);
                $('#staffScore').html(resData.staff.score);
                $('#totalScore').html(resData.total.score);
            }
        });
    }
    /**
     * 地址前缀
     * */
    function getDomain(){
        return '/api/msg/';
    }
</script>
</html>